//百度站点统计
var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?4691414cd889fadff7a35f960f455aeb";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();

function getSearchWords(search) {
    if (search.indexOf('?') == 0) {
        var str = search.substr(1);
        var arr = str.split('&');
        var opts = {};
        for (var i = 0; i < arr.length; i++) {
            var _item = arr[i];
            var index = _item.indexOf('=');
            var name = _item.substr(0, index);
            opts[name] = unescape(_item.substr(index + 1));
        }
        return opts;
    }
    return {};
}

function createSearchWords(opts, isNotStart) {
    if (!opts)
        return '';
    var _params = [];
    for (var opt in opts) {
        if (opt != "ReturnUrl")
            _params.push(opt + '=' + escape(opts[opt]));
    }
    if (_params.length > 0) {
        if (isNotStart)
            return _params.join('&');
        else
            return '&' + _params.join('&');
    } else
        return '';
}